<?php if ($error != ''): ?>
    <ul class="message error">
        <?php if ($error != ''): ?>
            <li><?php echo $error ?></li>
        <?php endif; ?>
        <?php echo form_error('phone') ?>
        <?php echo form_error('network') ?>
    </ul>
<?php endif; ?>
<form class="form has-validation" method="POST" action="">
    <input type="hidden" name="frmToken" id="frmToken" value="<?php echo $frmToken ?>"/>
    <div class="clearfix">
        <label for="form-phone" class="form-label">Số điện thoại<em>*</em><small>Nhập số điện thoại sim</small></label>
        <div class="form-input"><input type="text" sim="sim" id="form-phone" name="phone" required="required" /></div>
    </div>

    <div class="clearfix">
        <label for="form-network" class="form-label">Loại mạng<em>*</em><small>Sim thuộc mạng</small></label>
        <div class="form-input">
            <select id="form-network" name="network" required="required">
                <option value="">-Chọn nhà cung cấp-</option>
                <?php foreach ($listNetwork as $n): ?>
                    <option value="<?php echo $n['id'] ?>">Mạng <?php echo $n['name'] ?></option>
                <?php endforeach; ?>
            </select>
        </div>
    </div>

    <div class="clearfix">
        <label for="form-city" class="form-label">Đại lý<small>Sim thuộc đại lý</small></label>
        <div class="form-input">
            <select id="form-city" name="city">
                <option value="">-Chọn đại lý-</option>
                <?php foreach ($listCity as $c): ?>
                    <option value="<?php echo $c['id'] ?>">Mạng <?php echo $c['name'] ?></option>
                <?php endforeach; ?>
            </select>
        </div>
    </div>

    <div class="clearfix">
        <label for="form-group" class="form-label">Nhóm sim<small>Sim thuộc nhóm</small></label>
        <div class="form-input">
            <select id="form-group" name="group">
                <option value="">-Chọn nhóm sim-</option>
                <?php foreach ($listGroup as $g): ?>
                    <option value="<?php echo $g['id'] ?>"><?php echo $g['name'] ?></option>
                <?php endforeach; ?>
            </select>
        </div>
    </div>

    <div class="clearfix">
        <label for="form-price" class="form-label">Giá tiền<em>*</em><small>Nhập giá tiền của số điện thoại</small></label>
        <div class="form-input"><input type="text" id="form-price" name="price" required="required" /> <span style="color: red">VNĐ</span></div>
    </div>

    <div class="form-action clearfix">
        <input class="button" type="submit" name="submit" data-icon-primary="ui-icon-circle-check" value="OK"/>
        <input class="button" type="reset" value="Nhập lại"/>
    </div>
</form>

<script type="text/javascript">
    $(document).ready(function() {
        $('#form-price').setMask({
            mask: '999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999.99',
            type: 'reverse',
            defaultValue: '0'
        });
    });
</script>